Scripting, Macros and Custom Tools

Apex provides a Python scripting API to most of the capabilities it supports.

The scripting API can be used to describe a sequence of Apex operations that can subsequently be executed by Apex, causing the sequence of operations to be completed automatically, without the need for user input. This is commonly used to automate repetitive simulation workflows. 

Since the Apex scripting API is implemented using Python, and each Apex installation includes an integrated Python interpreter, the Apex specific operations provided by the API can be supplemented using any Python language constructs such as conditional and looping controls as well as capabilities available from any of the vast number of third party Python packages that are developed by the broader Python community. This combination is very flexible and can be used to extend Apex well beyond the capabilities that are delivered with each release.   

Apex currently provides two different patterns to execute scripts.

  • Macro Play enables a script, that may previously have been saved by recording interactive Apex operations, to be executed. This approach executes the script from beginning to end without user interaction.   
  • Custom tools enable not only 'batch' execution of scripts, but also construction of user interfaces that can be used to gather user inputs, including selection of Apex objects, to use as inputs to the logic defined in the script

The scripting API reference and useful information related to customization and automation of Apex is presented in the following pages